package com.epic.engine;

import com.epic.engine.model.Rule;
import com.epic.engine.streams.StreamSink;
import com.epic.engine.streams.StreamSource;
import org.apache.flink.connector.kafka.sink.KafkaSink;
import org.apache.flink.connector.kafka.source.KafkaSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.List;

public class Engine {
    private static Logger logger = LoggerFactory.getLogger(Engine.class);


    private List<Rule> rules;

    public void init(){

    }
    public void start(){
        try{
            final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
            KafkaSink<String> kafkaSink1 = new StreamSink("test1","localhost:9092").initSink();
            KafkaSink<String> kafkaSink2 = new StreamSink("test2","localhost:9092").initSink();


            env.execute();
        }catch (Exception e){
            logger.info(e.getMessage());
        }
    }
    public static void main(String[] args) {
        try{
            Engine engine = new Engine();
            engine.init();
            engine.start();
        }catch (Exception e){
            logger.error(e.getMessage());
        }
    }
}
/**
 * 核心设计思想 流流之间的操作
 */
